package com.caimiao.miao.service;

import android.content.Context;

import com.caimiao.miao.interfaces.IBaseModel;
import com.caimiao.miao.interfaces.IBasePresenter;
import com.caimiao.miao.interfaces.IBaseView;
import com.caimiao.miao.library.bluetooth.state.IBtState;

import io.reactivex.Observable;

public interface IBleContact {
    interface View extends IBaseView<Presenter> {
    }

    interface Presenter extends IBasePresenter {
        Observable<IBtState> setOutTicket(int num);

        void setReOutTicket();

        void postTickOut(Context context);
    }

    interface Model extends IBaseModel {
        void initBluetooth(Context context);

        void closeBle();

        Observable<byte[]> getBtRead();

        Observable<IBtState> getBtState();

        void setTicketOutNum(int num);

        void setTicketOutRemain(int remain);

        int getTicketOutRemain();

        boolean needOut();

        byte[] getCommand(boolean isResend);

        void write(byte[] value);

        void setReadBufferData(byte[] value);

        byte[] getReadBufferData();

        void clearReadBufferData();

        void removeReadBufferByIndex(int index);
    }
}
